package org.aplikator.server.rpc.handler;

import org.aplikator.client.rpc.impl.GetView;
import org.aplikator.client.rpc.impl.GetViewResponse;
import org.aplikator.server.Context;
import org.aplikator.server.DescriptorRegistry;
import org.aplikator.server.descriptor.View;
import org.aplikator.server.rpc.CommandHandler;

public class GetViewHandler implements CommandHandler<GetView, GetViewResponse> {

    public GetViewResponse execute(GetView command, Context ctx) {

        View view = (View) DescriptorRegistry.get().getDescriptionItem(command.getId());
        return new GetViewResponse(view.getViewDTO(ctx));
    }

}
